package com.chenshu.aop.proxy;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2024-04-20
 * Time：18:12
 */
public class Proxy implements Subject{
    private final RealSubject realSubject;
    public Proxy(RealSubject realSubject) {
        this.realSubject = realSubject;
    }

    @Override
    public void takeAdvertise() {
        System.out.println("我是代理人，开始收钱");
        realSubject.takeAdvertise();
        System.out.println("我是代理人，提供售后");
    }

    @Override
    public void giveConcert() {
        System.out.println("我是代理人，开始收钱");
        realSubject.giveConcert();
        System.out.println("我是代理人，提供售后");
    }
}
